Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

always attempt a live pod get on miss to confirm its really not there #1332

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dougbtv
Copy link
Member

@dougbtv dougbtv commented Sep 11, 2024

From openshift pull request:

This makes sure that stale caches never result in NotFound errors.

It was explained to me that informers are almost always are more efficient, and in most cases will work, but a live lookup is appropriate after a number of failures.

This happens only on the retry portion, so we're still getting the benefits of informers, but, on a retry situation, we don't get a cache miss.

@coveralls
Copy link

Coverage Status

coverage: 63.805% (-0.05%) from 63.857%
when pulling ea76290 on dougbtv:getlivepod
into 31e77aa on k8snetworkplumbingwg:master.

@@ -82,6 +82,10 @@ func (c *ClientInfo) GetPod(namespace, name string) (*v1.Pod, error) {
return c.Client.CoreV1().Pods(namespace).Get(context.TODO(), name, metav1.GetOptions{})
}

func (c *ClientInfo) GetPodLive(namespace, name string) (*v1.Pod, error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add comment for GetPodLive() function because it is not 'private' function?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants